package com.esri.core.internal.tasks.ags;

import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.io.UserCredentials;
import org.codehaus.jackson.JsonParser;
import org.codehaus.jackson.JsonToken;

/* loaded from: classes.dex */
public class af extends com.esri.core.internal.tasks.d<String> {
    private static final long serialVersionUID = 1;

    public af(al alVar, String str, UserCredentials userCredentials) {
        super(alVar, str, userCredentials);
    }

    public af(al alVar, String str, UserCredentials userCredentials, TaskListener<String> taskListener) {
        super(alVar, str, userCredentials, taskListener);
    }

    @Override // com.esri.core.internal.tasks.a
    /* renamed from: a */
    public String execute() throws Exception {
        JsonParser a = com.esri.core.internal.io.handler.h.a(this.serviceURL, this.actionInput.generateRequestParams(), getServiceCredentials());
        if (com.esri.core.internal.util.d.c(a)) {
            while (a.nextToken() != JsonToken.END_OBJECT) {
                String currentName = a.getCurrentName();
                a.nextToken();
                if (currentName.equals("currentVersion")) {
                    return a.getText();
                }
            }
        }
        return null;
    }
}
